<template>
	<view class="box">
		<view class="top">
			<view class="title">
				<u--text text='专注绿色甲醇数字化产业链,助力甲醇产业升级,确保国家能源安全,努力实现"碳中和""碳达峰"' color='#FFFFFF' size=13 :lines=2
					lineHeight='1.3em'></u--text>
				<view class="tel">
					<u--text text='400-666-666' mode='phone' color='#FFFFFF' size=13 lineHeight='1.3em'></u--text>
				</view>
			</view>
			<view class="advertisement">
				<u-swiper :list="list1" @click="click" radius=9></u-swiper>
			</view>
		</view>
		<view class="btns">
			<view class="btn">
				<view class="main" @click="callScan()">
					<u--image :showLoading="true" src="/static/home/scan.png" width="60rpx" height="60rpx"></u--image>
				</view>
				<u--text text="扫码" align="center"></u--text>
			</view>
			<view class="btn" @click="goToUrl('/pages/user/tickets')">
				<view class="main">
					<u--image :showLoading="true" src="/static/home/tickets.png" width="60rpx" height="60rpx"></u--image>
				</view>
				<u--text text="电子券" align="center"></u--text>
			</view>
			<view class="btn" @click="goToUrl('/pages/pay/charge')">
				<view class="main">
					<u--image :showLoading="true" src="/static/home/charge.png" width="60rpx" height="60rpx"></u--image>
				</view>
				<u--text text="充值" align="center"></u--text>
			</view>
			<view class="btn">
				<view class="main">
					<u--image :showLoading="true" src="/static/home/more.png" width="60rpx" height="60rpx"></u--image>
				</view>
				<u--text text="更多" align="center"></u--text>
			</view>

		</view>
		<!-- 滚动广告 -->
		<!-- <view class="advertisement1">
			<u-notice-bar :text="text1"></u-notice-bar>
		</view> -->
		<!-- 业务 -->
		<view class="business">
			<view class="title">
				<view class="line"></view>
				<u--text text="应用范围"></u--text>
			</view>
			<view class="b_btns">
				<view class="btn" @click="goToProduct(0)">
					<text>绿色小镇</text>

					<view class="bottom">
						<u-button text="立即进入" shape="circle"></u-button>
						<u--image :showLoading="true" src="/static/home/business1.png" width="40rpx"
							height="40rpx"></u--image>
					</view>
				</view>
				<view class="btn" @click="goToProduct(1)">
					<text>绿色乘级升级套件</text>

					<view class="bottom">
						<u-button text="立即进入" shape="circle"></u-button>
						<u--image :showLoading="true" src="/static/home/business2.png" width="40rpx"
							height="40rpx"></u--image>
					</view>
				</view>
				<view class="btn" @click="goToProduct(2)">
					<text>绿色甲醇发电机组</text>

					<view class="bottom">
						<u-button text="立即进入" shape="circle"></u-button>
						<u--image :showLoading="true" src="/static/home/business3.png" width="40rpx"
							height="40rpx"></u--image>
					</view>
				</view>
				<view class="btn" @click="goToProduct(3)">
					<text>绿色甲醇船舶</text>

					<view class="bottom">
						<u-button text="立即进入" shape="circle"></u-button>
						<u--image :showLoading="true" src="/static/home/business4.png" width="40rpx"
							height="40rpx"></u--image>
					</view>
				</view>
				<view class="btn" @click="goToProduct(4)">
					<text>撬装加注机</text>

					<view class="bottom">
						<u-button text="立即进入" shape="circle"></u-button>
						<u--image :showLoading="true" src="/static/home/business5.png" width="40rpx"
							height="40rpx"></u--image>
					</view>
				</view>
				<view class="btn" @click="goToProduct(5)">
					<text>数字化碳税</text>

					<view class="bottom">
						<u-button text="立即进入" shape="circle"></u-button>
						<u--image :showLoading="true" src="/static/home/business6.png" width="40rpx"
							height="40rpx"></u--image>
					</view>
				</view>

			</view>
		</view>
		<view class="business" style="margin-top: 0px!important;">
			<view class="title">
				<view class="line"></view>
				<u--text text="网点"></u--text>
			</view>
			<storeMap ref="store" width="100%" height="700rpx" @confirm="confirmAddress"></storeMap>
		</view>

		<!-- 地址列表 -->
		<view class="gaStation" style="margin-top: 30rpx;">
			<view class="item">
				<view class="top">
					<view class="left">
						<u--text text="醇易加海港路站" color="#1A1A1A" size=16 bold></u--text>
						<u--text text="海港大道39号" color="#767676" size=12></u--text>
					</view>
					<view class="right">
						<u-icon size="10" name="/static/home/map.png"></u-icon>
						<u--text text="7.02km" align="center"></u--text>
					</view>
				</view>
				<view class="bottom">
					<view class="left">
						<u--text text="今日醇价" size=10></u--text>
						<u--text text="2.0" size=30 color="#F21E46" bold lineHeight="1em"></u--text>
						<u--text text="/L起" size=10 color="#F21E46"></u--text>
					</view>
					<view class="right" @click="goToUrl('/pages/pay/refuel')">
						<u--text text="一键加醇" align="center" color="#FFFFFF" size=13></u--text>
					</view>
				</view>
			</view>

			<view class="item">
				<view class="top">
					<view class="left">
						<u--text text="醇易加海港路站" color="#1A1A1A" size=16 bold></u--text>
						<u--text text="海港大道39号" color="#767676" size=12></u--text>
					</view>
					<view class="right">
						<u-icon size="10" name="/static/home/map.png"></u-icon>
						<u--text text="7.02km" align="center"></u--text>
					</view>
				</view>
				<view class="bottom">
					<view class="left">
						<u--text text="今日醇价" size=10></u--text>
						<u--text text="2.2" size=30 color="#F21E46" bold lineHeight="1em"></u--text>
						<u--text text="/L起" size=10 color="#F21E46"></u--text>
					</view>
					<view class="right" @click="goToUrl('/pages/pay/refuel')">
						<u--text text="一键加醇" align="center" color="#FFFFFF" size=13></u--text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
import storeMap from "./store/store_map.vue";
export default {
	data() {
		return {
			list1:
				[
					'/static/home/swiper1.png',
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
				],
			text1: '欢迎某某汽车入驻本平台！'
		}
	},
	components: {
		storeMap
	},
	methods: {
		goToProduct(id) {
			const text = '/products' + id
			const url = '/pages/products' + text
			uni.navigateTo({
				url: url
			})
		},
		callScan() {
			uni.scanCode({
				success: function (res) {
					console.log("条码类型：" + res.scanType);
					console.log("条码内容：" + res.result);
				},
			});
		},
	}
}
</script>
<style scoped lang="scss">	.box>.top {
		background: linear-gradient(90deg, #1372E8 0%, #4F9CF8 100%);
		display: flex;
		flex-direction: column;
		padding: 30rpx 0 80rpx 0rpx;

		::v-deep .title {
			display: flex;
			justify-content: space-between;
			align-items: center;
			flex-wrap: nowrap;
			padding-left: 20rpx;

			.tel {
				background: linear-gradient(0deg, #FF8F1F 0%, #F6CE4C 100%);
				color: white;
				margin-left: 20rpx;
				padding-left: 14rpx;
				border-top-left-radius: 30rpx;
				border-bottom-left-radius: 30rpx;
				height: 50rpx;
				display: flex;
				align-items: center;
			}
		}

	}

	.advertisement {
		display: block;
		width: 700rpx;
		margin: 30rpx auto 0 auto;
	}

	::v-deep .advertisement1 {
		display: block;
		width: 700rpx;
		margin: 20rpx auto 40rpx auto;

		.u-notice-bar {
			border-radius: 50rpx;
			background-color: #E0EAFF !important;

			text {
				color: black !important;
			}
		}
	}

	.btns {
		margin: -60rpx auto 0 auto;
		padding: 30rpx 0;
		display: flex;
		justify-content: space-around;
		box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.16);
		width: 700rpx;
		border-radius: 15px;
		background-color: white;

		.btn {
			.main {
				box-shadow: 0px 3px 8px 0px rgba(0, 0, 0, 0.16);
				border-radius: 40rpx;
				width: 100rpx;
				height: 100rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				margin-bottom: 20rpx;
			}
		}

		.btn:nth-child(1) .main {
			background: linear-gradient(180deg, #58D8FC 0%, #41B6FE 99%);
		}

		.btn:nth-child(2) .main {
			background: linear-gradient(270deg, #D142F2 0%, #F184FE 99%);
		}

		.btn:nth-child(3) .main {
			background: linear-gradient(180deg, #FFC300 0%, #FF8F1F 100%);
		}

		.btn:nth-child(4) .main {
			background: linear-gradient(0deg, #4ACA7D 0%, #70E39D 100%);
		}
	}



	.business {
		width: 700rpx;
		margin: 50rpx auto 0rpx auto;

		.title {
			display: flex;
			align-items: center;
			justify-content: flex-start;
			margin-bottom: 16rpx;

			.line {
				width: 2px;
				height: 30rpx;
				background-color: #0256FF;
				margin-right: 10rpx;
			}
		}

		.b_btns {
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;

			.btn {
				width: 190rpx;
				border-radius: 20rpx;
				margin-bottom: 30rpx;
				padding: 16rpx;

				text {
					color: #fff;
					font-size: 22rpx;
				}

				.bottom {
					margin-top: 20rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;

					::v-deep .u-button {
						margin: 0 !important;
						border-radius: 20rpx !important;
						width: 100rpx !important;
						height: 40rpx !important;

						text {
							font-size: 20rpx !important;
						}
					}
				}
			}

			.btn:nth-child(1) {
				::v-deep .u-button text {
					color: #34B6E5 !important;
				}

				background: linear-gradient(180deg, #36ACEC 0%, #27FDB5 100%);
			}

			.btn:nth-child(2) {
				::v-deep .u-button text {
					color: #835EFC !important;
				}

				background: linear-gradient(180deg, #8054FC 0%, #D277F6 97%);
			}

			.btn:nth-child(3) {
				::v-deep .u-button text {
					color: #835EFC !important;
				}

				background: linear-gradient(180deg, #2598FF 0%, #A879FE 98%);
			}

			.btn:nth-child(4) {
				::v-deep .u-button text {
					color: #FC6BA7 !important;
				}

				background: linear-gradient(180deg, #FC69A2 0%, #FC80DC 100%);
			}

			.btn:nth-child(5) {
				::v-deep .u-button text {
					color: #FE7666 !important;
				}

				background: linear-gradient(180deg, #FE736D 0%, #FF9618 100%);
			}

			.btn:nth-child(6) {
				::v-deep .u-button text {
					color: #3A6BED !important;
				}

				background: linear-gradient(180deg, #3662EC 0%, #7CEAF6 100%);
			}
		}
	}



	.gaStation {
		width: 700rpx;
		margin: 0 auto;

		.item {
			justify-content: space-between;
			margin-bottom: 60rpx;

			.top {
				display: flex;
				justify-content: space-between;
				align-items: flex-end;
				margin-bottom: 30rpx;

				.right {
					width: 120rpx;
					height: 40rpx;
					border-radius: 20rpx;
					border: 1px solid rgba(0, 0, 0, 0.16);
					color: #767676;
					text-align: center;
					position: relative;
					padding-left: 24rpx;

					::v-deep .u-icon {
						position: absolute;
						top: 10rpx;
						left: 10rpx;
					}
				}
			}

			.bottom {
				display: flex;
				justify-content: space-between;
				align-items: flex-end;

				.left {
					display: flex;
					align-items: flex-end;
				}

				::v-deep .u-text {
					width: max-content !important;
					white-space: nowrap;
				}

				.right {
					display: flex;
					justify-content: center;
					align-items: center;
					width: 130rpx;
					height: 46rpx;
					border-radius: 10rpx;
					background: #3662EC;
					position: relative;
					padding-right: 20rpx;

					&:before {
						content: '';
						display: block;
						width: 0;
						height: 0;
						position: absolute;
						border-top: 5px solid transparent;
						border-bottom: 5px solid transparent;
						border-left: 8px solid #FFFFFF;
						border-right: 8px solid transparent;
						right: -8rpx;

					}
				}
			}

		}
	}
</style>
